package com.glsc.ngateway.common.base.domain.mysql.opmanage.report.regulatory;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.glsc.ngateway.common.base.utils.ExcelDoubleConverter;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Objects;

@Data
@Entity
@Table(name = "t_reg_rpt_self_market_making")
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
@ExcelIgnoreUnannotated
@IdClass(RegRptSelfMarketMaking.PK.class)
public class RegRptSelfMarketMaking {
    public static class PK implements Serializable {
        private BigInteger mainId;
        private BigInteger id;

        public BigInteger getMainId() {
            return mainId;
        }

        public void setMainId(BigInteger mainId) {
            this.mainId = mainId;
        }

        public BigInteger getId() {
            return id;
        }

        public void setId(BigInteger id) {
            this.id = id;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) {
                return true;
            }
            if (o == null || getClass() != o.getClass()) {
                return false;
            }
            PK pk = (PK) o;
            return Objects.equals(mainId, pk.mainId) && Objects.equals(id, pk.id);
        }

        @Override
        public int hashCode() {
            return Objects.hash(mainId, id);
        }
    }

    @Id
    @Column(name = "id")
    private BigInteger id;

    @Id
    @Column(name = "main_id")
    private BigInteger mainId;

    @ExcelProperty(index = 1)
    @Column(name = "fc_product_type")
    private String productType;

    @ExcelProperty(index = 2)
    @Column(name = "fc_business_type")
    private String businessType;

    @ExcelProperty(index = 3)
    @Column(name = "fc_market")
    private String market;

    @ExcelProperty(index = 4, converter = ExcelDoubleConverter.class)
    @Column(name = "ff_month_begin_position_scale")
    private Double beginScale;

    @ExcelProperty(index = 5, converter = ExcelDoubleConverter.class)
    @Column(name = "ff_month_begin_position_volume")
    private Double beginVolume;

    @ExcelProperty(index = 6, converter = ExcelDoubleConverter.class)
    @Column(name = "ff_month_begin_position_amount")
    private Double beginAmount;

    @ExcelProperty(index = 7, converter = ExcelDoubleConverter.class)
    @Column(name = "ff_scale_in")
    private Double scaleIn;

    @ExcelProperty(index = 8, converter = ExcelDoubleConverter.class)
    @Column(name = "ff_volume_in")
    private Double volumeIn;

    @ExcelProperty(index = 9, converter = ExcelDoubleConverter.class)
    @Column(name = "ff_scale_out")
    private Double scaleOut;

    @ExcelProperty(index = 10, converter = ExcelDoubleConverter.class)
    @Column(name = "ff_volume_out")
    private Double volumeOut;

    @ExcelProperty(index = 11, converter = ExcelDoubleConverter.class)
    @Column(name = "ff_fair_value_change_pl")
    private Double changePl;

    @ExcelProperty(index = 12, converter = ExcelDoubleConverter.class)
    @Column(name = "ff_realize_pl")
    private Double realizePl;

    @ExcelProperty(index = 13, converter = ExcelDoubleConverter.class)
    @Column(name = "ff_month_end_position_scale")
    private Double endScale;

    @ExcelProperty(index = 14, converter = ExcelDoubleConverter.class)
    @Column(name = "ff_month_end_position_volume")
    private Double endVolume;

    @ExcelProperty(index = 15, converter = ExcelDoubleConverter.class)
    @Column(name = "ff_month_end_position_amount")
    private Double endAmount;

    public void setId(BigInteger id) {
        this.id = id;
    }

    public BigInteger getId() {
        return id;
    }

    public BigInteger getMainId() {
        return mainId;
    }

    public void setMainId(BigInteger mainId) {
        this.mainId = mainId;
    }

    public String getProductType() {
        return productType;
    }

    public void setProductType(String productType) {
        this.productType = productType;
    }

    public String getBusinessType() {
        return businessType;
    }

    public void setBusinessType(String businessType) {
        this.businessType = businessType;
    }

    public String getMarket() {
        return market;
    }

    public void setMarket(String market) {
        this.market = market;
    }

    public Double getBeginScale() {
        return beginScale;
    }

    public void setBeginScale(Double beginScale) {
        this.beginScale = beginScale;
    }

    public Double getBeginVolume() {
        return beginVolume;
    }

    public void setBeginVolume(Double beginVolume) {
        this.beginVolume = beginVolume;
    }

    public Double getBeginAmount() {
        return beginAmount;
    }

    public void setBeginAmount(Double beginAmount) {
        this.beginAmount = beginAmount;
    }

    public Double getScaleIn() {
        return scaleIn;
    }

    public void setScaleIn(Double scaleIn) {
        this.scaleIn = scaleIn;
    }

    public Double getVolumeIn() {
        return volumeIn;
    }

    public void setVolumeIn(Double volumeIn) {
        this.volumeIn = volumeIn;
    }

    public Double getScaleOut() {
        return scaleOut;
    }

    public void setScaleOut(Double scaleOut) {
        this.scaleOut = scaleOut;
    }

    public void setVolumeOut(Double volumeOut) {
        this.volumeOut = volumeOut;
    }

    public Double getVolumeOut() {
        return volumeOut;
    }

    public Double getChangePl() {
        return changePl;
    }

    public void setChangePl(Double changePl) {
        this.changePl = changePl;
    }

    public Double getRealizePl() {
        return realizePl;
    }

    public void setRealizePl(Double realizePl) {
        this.realizePl = realizePl;
    }

    public Double getEndScale() {
        return endScale;
    }

    public void setEndScale(Double endScale) {
        this.endScale = endScale;
    }

    public Double getEndVolume() {
        return endVolume;
    }

    public void setEndVolume(Double endVolume) {
        this.endVolume = endVolume;
    }

    public Double getEndAmount() {
        return endAmount;
    }

    public void setEndAmount(Double endAmount) {
        this.endAmount = endAmount;
    }
}
